package com.wjy.provider.service;

import com.wjy.api.dto.UserAddDTO;
import com.wjy.api.dto.UserDTO;
import com.wjy.api.service.UserService;
import org.apache.dubbo.config.annotation.DubboService;

@DubboService(protocol = "dubbo", version = "1.0.0",validation = "true")
public class UserServiceImpl implements UserService {

    @Override
    public UserDTO get(Integer id) {
        UserDTO userDTO = new UserDTO();
        userDTO.setId(id);
        userDTO.setName("没有昵称:" + id);
        userDTO.setGender(id % 2 + 1);
        return userDTO;
    }

    @Override
    public Integer add(UserAddDTO addDTO) {
        return (int) (System.currentTimeMillis() / 1000);
    }
}
